<template>
  <el-dialog :visible.sync="visible" title="Detail" :show-close="false">
    <team-information ref="form" :form="form" />
    <player-information ref="table" :list="list" />
    <operation-button @fail="handleFail" @pass="handlePass" />
  </el-dialog>
</template>

<script>
import TeamInformation from '@/views/team-management/components/TeamInformation'
import PlayerInformation from '@/views/team-management/components/PlayerInformation'
import OperationButton from '@/views/team-management/team-register/components/OperationButton'
import { saveUpdate } from '@/api/team'
export default {
  name: 'CheckInformation',
  components: { OperationButton, PlayerInformation, TeamInformation },
  data() {
    return {
      form: { reg_status: 0 },
      list: []
    }
  },
  methods: {
    handleReset() {
      this.$refs.form.form = {}
      this.$refs.table.list = []
    },
    handleSubmit() {
      const form = this.$refs.form.form
      const list = this.$refs.table.list
      saveUpdate({ team: form, player: list }).then(response => {
        const { data } = response
        this.$message.info(data)
      })
    }
  }
}
</script>

<style scoped>

</style>
